package com.hdoit.ares.logical.cust.mapper;

import java.util.Date;
import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import com.hdoit.ares.logical.cust.model.Customer;
import com.hdoit.ares.logical.viewmodel.cust.CustomerSearch;
import com.tennetcn.common.dao.base.IMapper;
import com.tennetcn.common.message.PagerModel;

/**
 * @author      chenghuan
 * @email       
 * @createtime  2017年10月26日 16:12:04
 * @comment
 */
@Repository(value="customerMapper")
public interface CustomerMapper extends IMapper<Customer>{
	
	public List<Customer> queryListMP(@Param("search")CustomerSearch customerSearch,@Param("pager")PagerModel pagerModel);

    public Customer queryModelMP(String key);
     
    public int queryCountMP(@Param("search")CustomerSearch customerSearch);
     
    public List<Customer> queryListById(@Param("search")CustomerSearch customerSearch,@Param("pager")PagerModel pagerModel,@Param("key")String key);
    
    public int queryCountById(@Param("search")CustomerSearch customerSearch,@Param("key")String key);
    
    public List<Customer> queryListByBuyer(String loginId);
    
    public List<Customer> queryListForAward(@Param("startDate")Date startDate,@Param("endDate")Date endDate);

    //查询城市下的每一天的关注数增加情况
    public int queryCustCount(@Param("year")String year,@Param("month")String month,@Param("day")String day,@Param("nativeCity")String nativeCity);
    
    //查询城市下从开始到这一天的关注总数
    public int queryAllCustCount(@Param("date")String date,@Param("nativeCity")String nativeCity);
    
    //查询每日招募创客数
    public int queryCountDayMakers(@Param("refereeId")String refereeId);
    
    //查询每周招募创客数
    public int queryCountWeekMakers(@Param("refereeId")String refereeId);
    
    //查询每月招募创客数
    public int queryCountMonthMakers(@Param("refereeId")String refereeId);
    
    //查询用户下一级的所有游客
    public List<Customer> queryNextVisitors(@Param("refereeId")String refereeId);
    
}
